﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IrisMembership.DomainClasses.Configurations
{
    public class RoleConfig : EntityTypeConfiguration<Role>
    {
        public RoleConfig()
        {
            Property(r => r.Name).IsRequired().HasMaxLength(300);
            HasOptional(r => r.ParentRole).WithMany(r => r.ChildrenRoles).HasForeignKey(r => r.ParentRoleId).WillCascadeOnDelete(false);
        }
    }
}
